package com.example.common.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import lombok.Data;

import java.math.BigInteger;
import java.util.Objects;

/*
 * id for sys_user_jobs
 */
@Embeddable
@Data
public class SysUserJobsId {
    @Column(name = "user_id")
    private BigInteger userId;
    @Column(name = "job_id")
    private BigInteger jobId;
    
    public BigInteger getUserId() {
        return userId;
    }
    
    public void setUserId(BigInteger userId) {
        this.userId = userId;
    }
    
    public BigInteger getJobId() {
        return jobId;
    }
    
    public void setJobId(BigInteger jobId) {
        this.jobId = jobId;
    }
    
    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        SysUserJobsId that = (SysUserJobsId) o;
        return Objects.equals(userId, that.userId) && Objects.equals(jobId, that.jobId);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(userId, jobId);
    }
}
